package testBingMap;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * @author cj91
 * 
 */
@XmlType(propOrder = {})
@XmlAccessorType(XmlAccessType.FIELD)
public class MemberPK implements Serializable {
	private static final long serialVersionUID = 5L;

	@XmlElement(nillable = false, required = true)
	private Integer customerId;
	@XmlElement(nillable = false, required = true)
	private Integer clientId;

	@XmlElement(nillable = false, required = true)
	private Integer groupInternalId;
	@XmlElement(nillable = false, required = true)
	private String memberId;

	/**
	 * 
	 */
	public MemberPK() {
	}

	/**
	 * @param customerId customerId
	 * @param clientId clientId
	 * @param groupInternalId groupInternalId
	 * @param memberId memberId
	 */
	public MemberPK(Integer customerId, Integer clientId, Integer groupInternalId, String memberId) {
		this.customerId = customerId;
		this.clientId = clientId;
		this.groupInternalId = groupInternalId;
		this.memberId = memberId;
	}

	/**
	 * @return the customerId
	 */
	public Integer getCustomerId() {
		return customerId;
	}

	/**
	 * @param customerId
	 *            the customerId to set
	 */
	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	/**
	 * @return the clientId
	 */
	public Integer getClientId() {
		return clientId;
	}

	/**
	 * @param clientId
	 *            the clientId to set
	 */
	public void setClientId(Integer clientId) {
		this.clientId = clientId;
	}

	/**
	 * @return the groupInternalId
	 */
	public Integer getGroupInternalId() {
		return groupInternalId;
	}

	/**
	 * @param groupInternalId
	 *            the groupInternalId to set
	 */
	public void setGroupInternalId(Integer groupInternalId) {
		this.groupInternalId = groupInternalId;
	}

	/**
	 * @return the memberId
	 */
	public String getMemberId() {
		return memberId;
	}

	/**
	 * @param memberId
	 *            the memberId to set
	 */
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((clientId == null) ? 0 : clientId.hashCode());
		result = prime * result + ((customerId == null) ? 0 : customerId.hashCode());
		result = prime * result + ((groupInternalId == null) ? 0 : groupInternalId.hashCode());
		result = prime * result + ((memberId == null) ? 0 : memberId.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof MemberPK)) {
			return false;
		}
		MemberPK other = (MemberPK) obj;
		if (clientId == null) {
			if (other.clientId != null) {
				return false;
			}
		} else if (!clientId.equals(other.clientId)) {
			return false;
		}
		if (customerId == null) {
			if (other.customerId != null) {
				return false;
			}
		} else if (!customerId.equals(other.customerId)) {
			return false;
		}
		if (groupInternalId == null) {
			if (other.groupInternalId != null) {
				return false;
			}
		} else if (!groupInternalId.equals(other.groupInternalId)) {
			return false;
		}
		if (memberId == null) {
			if (other.memberId != null) {
				return false;
			}
		} else if (!memberId.equals(other.memberId)) {
			return false;
		}
		return true;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		return "MemberPK [" + (clientId != null ? "clientId=" + clientId + ", " : "")
			+ (customerId != null ? "customerId=" + customerId + ", " : "")
			+ (groupInternalId != null ? "groupInternalId=" + groupInternalId + ", " : "")
			+ (memberId != null ? "memberId=" + memberId : "") + "]";
	}

}
